package com.glsc.ngateway.common.base.domainmapper;

import com.glsc.ngateway.common.api.platform.dto.it.SwitchBoardExport;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class SwitchBoardRowMapper implements RowMapper<SwitchBoardExport> {

    @Override
    public SwitchBoardExport mapRow(ResultSet rs, int rowNum) throws SQLException {
        SwitchBoardExport switchBoardExport = new SwitchBoardExport();
        switchBoardExport.setSwitchIp(rs.getString("switch_ip"));
        switchBoardExport.setSwitchInterface(rs.getString("switch_interface"));
        switchBoardExport.setBusinessName(rs.getString("business_name"));
        switchBoardExport.setApplicationDetail(rs.getString("application_detail"));
        switchBoardExport.setMachineRoom(rs.getString("machine_room"));
        switchBoardExport.setMachineCab(rs.getString("machine_cab"));
        switchBoardExport.setMachineUnit(rs.getString("machine_unit"));
        switchBoardExport.setMacAddress(rs.getString("mac_address"));
        switchBoardExport.setVirtualName(rs.getString("virtual_name"));
        switchBoardExport.setVirtualIp(rs.getString("virtual_ip"));
        switchBoardExport.setIp1(rs.getString("ip1"));
        switchBoardExport.setIp2(rs.getString("ip2"));
        switchBoardExport.setName(rs.getString("name"));

        return switchBoardExport;
    }

}
